#include <srts/stratego.h>
#include <stratego-lib/stratego-lib.h>
void init_constructors (void)
{
}
static Symbol sym__3;
static Symbol sym__2;
static Symbol sym_Nil_0;
static Symbol sym_StringLit_1;
static Symbol sym_Declaration2_2;
static Symbol sym_Id_1;
static Symbol sym_IdDecl_3;
static Symbol sym_FunDef_3;
static Symbol sym_Field_2;
static Symbol sym_Compound_2;
static Symbol sym_Extern_0;
static Symbol sym_Promote_0;
static Symbol sym_DeclSpec_2;
static Symbol sym_Cons_2;
static void init_module_constructors (void)
{
sym__3 = ATmakeSymbol("", 3, ATfalse);
ATprotectSymbol(sym__3);
sym__2 = ATmakeSymbol("", 2, ATfalse);
ATprotectSymbol(sym__2);
sym_Nil_0 = ATmakeSymbol("Nil", 0, ATfalse);
ATprotectSymbol(sym_Nil_0);
sym_StringLit_1 = ATmakeSymbol("StringLit", 1, ATfalse);
ATprotectSymbol(sym_StringLit_1);
sym_Declaration2_2 = ATmakeSymbol("Declaration2", 2, ATfalse);
ATprotectSymbol(sym_Declaration2_2);
sym_Id_1 = ATmakeSymbol("Id", 1, ATfalse);
ATprotectSymbol(sym_Id_1);
sym_IdDecl_3 = ATmakeSymbol("IdDecl", 3, ATfalse);
ATprotectSymbol(sym_IdDecl_3);
sym_FunDef_3 = ATmakeSymbol("FunDef", 3, ATfalse);
ATprotectSymbol(sym_FunDef_3);
sym_Field_2 = ATmakeSymbol("Field", 2, ATfalse);
ATprotectSymbol(sym_Field_2);
sym_Compound_2 = ATmakeSymbol("Compound", 2, ATfalse);
ATprotectSymbol(sym_Compound_2);
sym_Extern_0 = ATmakeSymbol("Extern", 0, ATfalse);
ATprotectSymbol(sym_Extern_0);
sym_Promote_0 = ATmakeSymbol("Promote", 0, ATfalse);
ATprotectSymbol(sym_Promote_0);
sym_DeclSpec_2 = ATmakeSymbol("DeclSpec", 2, ATfalse);
ATprotectSymbol(sym_DeclSpec_2);
sym_Cons_2 = ATmakeSymbol("Cons", 2, ATfalse);
ATprotectSymbol(sym_Cons_2);
}
static ATerm term29;
static ATerm term28;
static ATerm term27;
static ATerm term26;
static ATerm term25;
static ATerm term24;
static ATerm term23;
static ATerm term22;
static ATerm term21;
static ATerm term20;
static ATerm term19;
static ATerm term18;
static ATerm term17;
static ATerm term16;
static ATerm term15;
static ATerm term14;
static ATerm term13;
static ATerm term12;
static ATerm term11;
static ATerm term10;
static ATerm term9;
static ATerm term8;
static ATerm term7;
static ATerm term6;
static ATerm term5;
static ATerm term4;
static ATerm term3;
static ATerm term2;
static ATerm term1;
static ATerm term0;
static void init_module_constant_terms (void)
{
ATprotect(&(term0));
term0 = (ATerm) ATmakeInt(1);
ATprotect(&(term1));
term1 = term0;
ATprotect(&(term2));
term2 = (ATerm) ATmakeAppl(ATmakeSymbol("global", 0, ATtrue));
ATprotect(&(term3));
term3 = term2;
ATprotect(&(term4));
term4 = (ATerm) ATmakeAppl(ATmakeSymbol("symbols", 0, ATtrue));
ATprotect(&(term5));
term5 = term4;
ATprotect(&(term6));
term6 = (ATerm) ATmakeAppl(sym__3, term3, term5, (ATerm) ATempty);
ATprotect(&(term7));
term7 = term6;
ATprotect(&(term8));
term8 = (ATerm) ATmakeAppl(ATmakeSymbol("promoted-symbols", 0, ATtrue));
ATprotect(&(term9));
term9 = term8;
ATprotect(&(term10));
term10 = (ATerm) ATmakeAppl(sym__3, term3, term9, (ATerm) ATempty);
ATprotect(&(term11));
term11 = term10;
ATprotect(&(term12));
term12 = (ATerm) ATmakeAppl(ATmakeSymbol("unique", 0, ATtrue));
ATprotect(&(term13));
term13 = term12;
ATprotect(&(term14));
term14 = (ATerm) ATmakeAppl(sym__2, term3, term9);
ATprotect(&(term15));
term15 = term14;
ATprotect(&(term16));
term16 = (ATerm) ATmakeAppl(sym__2, term3, term5);
ATprotect(&(term17));
term17 = term16;
ATprotect(&(term18));
term18 = (ATerm) ATmakeAppl(ATmakeSymbol("STACK FRAME", 0, ATtrue));
ATprotect(&(term19));
term19 = term18;
ATprotect(&(term20));
term20 = (ATerm) ATmakeAppl(sym__2, term3, term13);
ATprotect(&(term21));
term21 = term20;
ATprotect(&(term22));
term22 = (ATerm) ATmakeInt(42);
ATprotect(&(term23));
term23 = term22;
ATprotect(&(term24));
term24 = (ATerm) ATmakeInt(95);
ATprotect(&(term25));
term25 = term24;
ATprotect(&(term26));
term26 = (ATerm) ATmakeAppl(sym_Extern_0);
ATprotect(&(term27));
term27 = term26;
ATprotect(&(term28));
term28 = (ATerm) ATmakeAppl(sym_Promote_0);
ATprotect(&(term29));
term29 = term28;
}
#include <srts/init-stratego-application.h>
extern const char * __tracing_table [];
extern unsigned short __tracing_table_counter;
ATerm table_get_0_0 (StrSL sl, ATerm t);
ATerm table_put_0_0 (StrSL sl, ATerm t);
ATerm table_create_0_0 (StrSL sl, ATerm t);
ATerm drop_1_0 (StrSL sl, StrCL p_86, ATerm t);
ATerm init_0_0 (StrSL sl, ATerm t);
ATerm split_fetch_1_0 (StrSL sl, StrCL j_82, ATerm t);
ATerm fetch_elem_1_0 (StrSL sl, StrCL h_82, ATerm t);
ATerm elem_0_0 (StrSL sl, ATerm t);
ATerm length_0_0 (StrSL sl, ATerm t);
ATerm map_1_0 (StrSL sl, StrCL z_81, ATerm t);
ATerm Snd_0_0 (StrSL sl, ATerm t);
ATerm try_1_0 (StrSL sl, StrCL x_58, ATerm t);
ATerm alltd_1_0 (StrSL sl, StrCL l_52, ATerm t);
ATerm strcat_0_0 (StrSL sl, ATerm t);
ATerm explode_string_0_0 (StrSL sl, ATerm t);
ATerm implode_string_0_0 (StrSL sl, ATerm t);
ATerm newname_0_0 (StrSL sl, ATerm t);
ATerm io_wrap_1_0 (StrSL sl, StrCL r_42, ATerm t);
static ATerm lifted17 (StrSL sl, ATerm t);
static ATerm lifted15 (StrSL sl, ATerm t);
static ATerm lifted13 (StrSL sl, ATerm t);
static ATerm lifted12 (StrSL sl, ATerm t);
static ATerm lifted11 (StrSL sl, ATerm t);
static ATerm lifted10 (StrSL sl, ATerm t);
static ATerm lifted9 (StrSL sl, ATerm t);
ATerm ScrambleVariables_0_0 (StrSL sl, ATerm t);
static ATerm lifted8 (StrSL sl, ATerm t);
static ATerm lifted7 (StrSL sl, ATerm t);
ATerm replace_2_0 (StrSL sl, StrCL f_17, StrCL g_17, ATerm t);
static ATerm lifted6 (StrSL sl, ATerm t);
static ATerm lifted5 (StrSL sl, ATerm t);
ATerm pop_frame_0_0 (StrSL sl, ATerm t);
ATerm push_frame_0_0 (StrSL sl, ATerm t);
ATerm put_promoted_symbol_0_0 (StrSL sl, ATerm t);
ATerm put_symbol_0_0 (StrSL sl, ATerm t);
static ATerm lifted4 (StrSL sl, ATerm t);
static ATerm lifted3 (StrSL sl, ATerm t);
ATerm get_symbol_0_0 (StrSL sl, ATerm t);
static ATerm lifted1 (StrSL sl, ATerm t);
ATerm scramblevariables_0_0 (StrSL sl, ATerm t);
ATerm main_0_0 (StrSL sl, ATerm t);
ATerm ScrambleVariables_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "ScrambleVariables_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm trm11 = t;
ATerm i_18 = NULL,j_18 = NULL,k_18 = NULL;
if(match_cons(t, sym_Id_1))
{
i_18 = ATgetArgument(t, 0);
}
else
goto label7 ;
k_18 = t;
t = i_18;
t = get_symbol_0_0(sl, t);
if((t == NULL))
goto label7 ;
if(match_cons(t, sym__2))
{
ATerm trm12 = ATgetArgument(t, 0);
j_18 = ATgetArgument(t, 1);
}
else
goto label7 ;
t = k_18;
t = (ATerm) ATmakeAppl(sym_Id_1, j_18);
goto label6 ;
label7 :
t = trm11;
{
ATerm trm13 = t;
ATerm x_17 = NULL,y_17 = NULL,z_17 = NULL,a_18 = NULL,b_18 = NULL,c_18 = NULL,d_18 = NULL,e_18 = NULL,f_18 = NULL,g_18 = NULL,h_18 = NULL;
b_18 = t;
if(match_cons(t, sym_Declaration2_2))
{
y_17 = ATgetArgument(t, 0);
{
ATerm trm14 = ATgetArgument(t, 1);
if(((ATgetType(trm14) == AT_LIST) && !(ATisEmpty(trm14))))
{
ATerm trm15 = ATgetFirst((ATermList) trm14);
if(match_cons(trm15, sym_IdDecl_3))
{
ATerm trm16 = ATgetArgument(trm15, 0);
ATerm trm17 = ATgetArgument(trm15, 1);
if(match_cons(trm17, sym_Id_1))
{
x_17 = ATgetArgument(trm17, 0);
}
else
goto label8 ;
{
ATerm trm18 = ATgetArgument(trm15, 2);
}
}
else
goto label8 ;
{
ATerm trm19 = (ATerm) ATgetNext((ATermList) trm14);
if(!(((ATgetType(trm19) == AT_LIST) && ATisEmpty(trm19))))
goto label8 ;
}
}
else
goto label8 ;
}
}
else
goto label8 ;
d_18 = t;
f_18 = t;
t = term21;
t = table_get_0_0(sl, t);
if((t == NULL))
goto label8 ;
h_18 = t;
g_18 = t;
t = (ATerm) ATmakeAppl(sym__2, g_18, x_17);
t = strcat_0_0(sl, t);
if((t == NULL))
goto label8 ;
{
struct str_closure u_165 = { &(lifted9) , &(frame) };
StrCL lifted9_cl = &(u_165);
struct str_closure v_165 = { &(lifted10) , &(frame) };
StrCL lifted10_cl = &(v_165);
t = replace_2_0(sl, lifted9_cl, lifted10_cl, t);
if((t == NULL))
goto label8 ;
t = newname_0_0(sl, t);
if((t == NULL))
goto label8 ;
{
struct str_closure z_165 = { &(lifted11) , &(frame) };
StrCL lifted11_cl = &(z_165);
struct str_closure a_166 = { &(lifted12) , &(frame) };
StrCL lifted12_cl = &(a_166);
t = replace_2_0(sl, lifted11_cl, lifted12_cl, t);
if((t == NULL))
goto label8 ;
e_18 = t;
t = f_18;
t = (ATerm) ATmakeAppl(sym__2, x_17, e_18);
a_18 = t;
{
ATerm trm20 = t;
t = y_17;
if(match_cons(t, sym_DeclSpec_2))
{
z_17 = ATgetArgument(t, 0);
{
ATerm trm21 = ATgetArgument(t, 1);
}
}
else
goto label10 ;
t = (ATerm) ATmakeAppl(sym__2, term27, z_17);
t = elem_0_0(sl, t);
if((t == NULL))
goto label10 ;
goto label8 ;
label10 :
t = trm20;
goto label9 ;
label9 :
;
{
ATerm trm22 = t;
ATerm trm23 = t;
t = x_17;
t = get_symbol_0_0(sl, t);
if((t == NULL))
goto label14 ;
goto label12 ;
label14 :
t = trm23;
goto label13 ;
label13 :
;
t = y_17;
if(match_cons(t, sym_DeclSpec_2))
{
if((z_17 == NULL))
{
z_17 = ATgetArgument(t, 0);
}
else
if((z_17 != ATgetArgument(t, 0)))
goto label12 ;
{
ATerm trm24 = ATgetArgument(t, 1);
}
}
else
goto label12 ;
t = (ATerm) ATmakeAppl(sym__2, term29, z_17);
t = elem_0_0(sl, t);
if((t == NULL))
goto label12 ;
t = a_18;
t = put_promoted_symbol_0_0(sl, t);
if((t == NULL))
goto label12 ;
goto label11 ;
label12 :
t = trm22;
t = a_18;
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto label8 ;
else
goto label11 ;
label11 :
;
t = b_18;
{
struct str_closure c_166 = { &(lifted13) , &(frame) };
StrCL lifted13_cl = &(c_166);
t = SRTS_all(sl, lifted13_cl, t);
if((t == NULL))
goto label8 ;
c_18 = t;
t = d_18;
t = c_18;
}
}
}
}
}
goto label6 ;
label8 :
t = trm13;
{
ATerm trm25 = t;
ATerm p_17 = NULL,q_17 = NULL,r_17 = NULL,s_17 = NULL,t_17 = NULL,u_17 = NULL,v_17 = NULL,w_17 = NULL;
q_17 = t;
if(match_cons(t, sym_FunDef_3))
{
ATerm trm26 = ATgetArgument(t, 0);
ATerm trm27 = ATgetArgument(t, 1);
if(match_cons(trm27, sym_IdDecl_3))
{
ATerm trm28 = ATgetArgument(trm27, 0);
ATerm trm29 = ATgetArgument(trm27, 1);
if(match_cons(trm29, sym_Id_1))
{
p_17 = ATgetArgument(trm29, 0);
}
else
goto label15 ;
{
ATerm trm30 = ATgetArgument(trm27, 2);
}
}
else
goto label15 ;
{
ATerm trm31 = ATgetArgument(t, 2);
}
}
else
goto label15 ;
s_17 = t;
u_17 = t;
t = term21;
t = table_get_0_0(sl, t);
if((t == NULL))
goto label15 ;
w_17 = t;
v_17 = t;
t = (ATerm) ATmakeAppl(sym__2, v_17, p_17);
t = strcat_0_0(sl, t);
if((t == NULL))
goto label15 ;
t = newname_0_0(sl, t);
if((t == NULL))
goto label15 ;
t_17 = t;
t = u_17;
t = (ATerm) ATmakeAppl(sym__2, p_17, t_17);
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto label15 ;
t = q_17;
{
struct str_closure e_166 = { &(lifted15) , &(frame) };
StrCL lifted15_cl = &(e_166);
t = SRTS_all(sl, lifted15_cl, t);
if((t == NULL))
goto label15 ;
r_17 = t;
t = s_17;
t = r_17;
}
goto label6 ;
label15 :
t = trm25;
{
ATerm trm32 = t;
ATerm m_17 = NULL,n_17 = NULL,o_17 = NULL;
m_17 = t;
if(match_cons(t, sym_Compound_2))
{
ATerm trm33 = ATgetArgument(t, 0);
ATerm trm34 = ATgetArgument(t, 1);
}
else
goto label16 ;
o_17 = t;
t = push_frame_0_0(sl, t);
if((t == NULL))
goto label16 ;
t = m_17;
{
struct str_closure g_166 = { &(lifted17) , &(frame) };
StrCL lifted17_cl = &(g_166);
t = SRTS_all(sl, lifted17_cl, t);
if((t == NULL))
goto label16 ;
n_17 = t;
t = pop_frame_0_0(sl, t);
if((t == NULL))
goto label16 ;
t = o_17;
t = n_17;
}
goto label6 ;
label16 :
t = trm32;
{
ATerm h_17 = NULL,i_17 = NULL,j_17 = NULL,k_17 = NULL,l_17 = NULL;
h_17 = t;
if(match_cons(t, sym_Field_2))
{
i_17 = ATgetArgument(t, 0);
{
ATerm trm35 = ATgetArgument(t, 1);
if(match_cons(trm35, sym_Id_1))
{
j_17 = ATgetArgument(trm35, 0);
}
else
goto fail15 ;
}
}
else
goto fail15 ;
l_17 = t;
t = i_17;
{
struct str_closure h_166 = { &(ScrambleVariables_0_0) , sl };
StrCL lifted19_cl = &(h_166);
t = alltd_1_0(sl, lifted19_cl, t);
if((t == NULL))
goto fail15 ;
k_17 = t;
t = l_17;
t = (ATerm) ATmakeAppl(sym_Field_2, k_17, (ATerm) ATmakeAppl(sym_Id_1, j_17));
goto label6 ;
}
}
}
}
}
label6 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail15 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted17 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted17";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure f_166 = { &(ScrambleVariables_0_0) , sl_up(sl) };
StrCL lifted18_cl = &(f_166);
t = alltd_1_0(sl_up(sl), lifted18_cl, t);
if((t == NULL))
goto fail22 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail22 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted15 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted15";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure d_166 = { &(ScrambleVariables_0_0) , sl_up(sl) };
StrCL lifted16_cl = &(d_166);
t = alltd_1_0(sl_up(sl), lifted16_cl, t);
if((t == NULL))
goto fail21 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail21 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted13 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted13";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure b_166 = { &(ScrambleVariables_0_0) , sl_up(sl) };
StrCL lifted14_cl = &(b_166);
t = alltd_1_0(sl_up(sl), lifted14_cl, t);
if((t == NULL))
goto fail20 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail20 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted12 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted12";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term25;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail19 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted11 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted11";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!(((ATgetType(t) == AT_INT) && (ATgetInt((ATermInt) t) == 42))))
goto fail18 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail18 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted10 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted10";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term23;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail17 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted9 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted9";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!(((ATgetType(t) == AT_INT) && (ATgetInt((ATermInt) t) == 95))))
goto fail16 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail16 :
--__tracing_table_counter;
return(NULL);
}
ATerm replace_2_0 (StrSL sl, StrCL f_17, StrCL g_17, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "replace_2_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
sl_funs(2);
sl_init_fun(0, f_17);
sl_init_fun(1, g_17);
t = explode_string_0_0(sl, t);
if((t == NULL))
goto fail12 ;
{
struct str_closure t_165 = { &(lifted7) , &(frame) };
StrCL lifted7_cl = &(t_165);
t = map_1_0(sl, lifted7_cl, t);
if((t == NULL))
goto fail12 ;
t = implode_string_0_0(sl, t);
if((t == NULL))
goto fail12 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail12 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted7 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted7";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure s_165 = { &(lifted8) , &(frame) };
StrCL lifted8_cl = &(s_165);
t = try_1_0(sl_up(sl), lifted8_cl, t);
if((t == NULL))
goto fail13 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail13 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted8 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted8";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = sl_fun(0, sl_up(sl))(sl_fun_sl(0, sl_up(sl)), t);
if((t == NULL))
goto fail14 ;
t = sl_fun(1, sl_up(sl))(sl_fun_sl(1, sl_up(sl)), t);
if((t == NULL))
goto fail14 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail14 :
--__tracing_table_counter;
return(NULL);
}
ATerm pop_frame_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "pop_frame_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure r_165 = { &(lifted5) , &(frame) };
StrCL lifted5_cl = &(r_165);
t = term17;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail9 ;
t = try_1_0(sl, lifted5_cl, t);
if((t == NULL))
goto fail9 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail9 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted5 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted5";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm d_17 = NULL,e_17 = NULL;
struct str_closure q_165 = { &(lifted6) , &(frame) };
StrCL lifted6_cl = &(q_165);
t = split_fetch_1_0(sl_up(sl), lifted6_cl, t);
if((t == NULL))
goto fail10 ;
e_17 = t;
t = Snd_0_0(sl_up(sl), t);
if((t == NULL))
goto fail10 ;
d_17 = t;
t = e_17;
t = (ATerm) ATmakeAppl(sym__3, term3, term5, d_17);
t = table_put_0_0(sl_up(sl), t);
if((t == NULL))
goto fail10 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail10 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted6 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted6";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!((ATgetSymbol(t) == ATmakeSymbol("STACK FRAME", 0, ATtrue))))
goto fail11 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail11 :
--__tracing_table_counter;
return(NULL);
}
ATerm push_frame_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "push_frame_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term17;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail8 ;
t = length_0_0(sl, t);
if((t == NULL))
goto fail8 ;
{
ATerm trm10 = t;
if(!(((ATgetType(t) == AT_INT) && (ATgetInt((ATermInt) t) == 0))))
goto label5 ;
goto label4 ;
label5 :
t = trm10;
t = term19;
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto fail8 ;
else
goto label4 ;
label4 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail8 :
--__tracing_table_counter;
return(NULL);
}
ATerm put_promoted_symbol_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "put_promoted_symbol_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm a_17 = NULL,b_17 = NULL,c_17 = NULL;
a_17 = t;
t = term15;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail7 ;
c_17 = t;
b_17 = t;
{
ATerm trm9;
trm9 = CheckATermList(b_17);
if((trm9 == NULL))
goto fail7 ;
t = (ATerm) ATmakeAppl(sym__3, term3, term9, (ATerm) ATinsert((ATermList)trm9, a_17));
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail7 ;
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail7 :
--__tracing_table_counter;
return(NULL);
}
ATerm put_symbol_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "put_symbol_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm x_16 = NULL,y_16 = NULL,z_16 = NULL;
x_16 = t;
t = term17;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail6 ;
z_16 = t;
y_16 = t;
{
ATerm trm8;
trm8 = CheckATermList(y_16);
if((trm8 == NULL))
goto fail6 ;
t = (ATerm) ATmakeAppl(sym__3, term3, term5, (ATerm) ATinsert((ATermList)trm8, x_16));
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail6 ;
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail6 :
--__tracing_table_counter;
return(NULL);
}
ATerm get_symbol_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "get_symbol_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
sl_vars(1);
{
ATerm w_16 = NULL;
sl_init_var(0, w_16);
{
ATerm trm5 = t;
struct str_closure o_165 = { &(lifted3) , &(frame) };
StrCL lifted3_cl = &(o_165);
if((w_16 == NULL))
{
w_16 = t;
}
else
if((w_16 != t))
goto label3 ;
t = term15;
t = table_get_0_0(sl, t);
if((t == NULL))
goto label3 ;
t = fetch_elem_1_0(sl, lifted3_cl, t);
if((t == NULL))
goto label3 ;
goto label2 ;
label3 :
t = trm5;
{
struct str_closure p_165 = { &(lifted4) , &(frame) };
StrCL lifted4_cl = &(p_165);
t = term17;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail3 ;
t = fetch_elem_1_0(sl, lifted4_cl, t);
if((t == NULL))
goto fail3 ;
else
goto label2 ;
}
label2 :
;
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail3 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted4 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted4";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(match_cons(t, sym__2))
{
if((sl_readvar(0, sl) == NULL))
{
sl_readvar(0, sl) = ATgetArgument(t, 0);
}
else
if((sl_readvar(0, sl) != ATgetArgument(t, 0)))
goto fail5 ;
{
ATerm trm7 = ATgetArgument(t, 1);
}
}
else
goto fail5 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail5 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted3 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted3";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(match_cons(t, sym__2))
{
if((sl_readvar(0, sl) == NULL))
{
sl_readvar(0, sl) = ATgetArgument(t, 0);
}
else
if((sl_readvar(0, sl) != ATgetArgument(t, 0)))
goto fail4 ;
{
ATerm trm6 = ATgetArgument(t, 1);
}
}
else
goto fail4 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail4 :
--__tracing_table_counter;
return(NULL);
}
ATerm scramblevariables_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "scramblevariables_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm q_16 = NULL,r_16 = NULL,s_16 = NULL,t_16 = NULL,u_16 = NULL;
struct str_closure m_165 = { &(ScrambleVariables_0_0) , sl };
StrCL lifted2_cl = &(m_165);
if(match_cons(t, sym__2))
{
u_16 = ATgetArgument(t, 0);
q_16 = ATgetArgument(t, 1);
}
else
goto fail1 ;
t = q_16;
{
ATerm trm0 = t;
ATerm v_16 = NULL;
if(match_cons(t, sym_StringLit_1))
{
ATerm trm1 = ATgetArgument(t, 0);
if(((ATgetType(trm1) == AT_LIST) && !(ATisEmpty(trm1))))
{
v_16 = ATgetFirst((ATermList) trm1);
{
ATerm trm2 = (ATerm) ATgetNext((ATermList) trm1);
if(!(((ATgetType(trm2) == AT_LIST) && ATisEmpty(trm2))))
goto label1 ;
}
}
else
goto label1 ;
}
else
goto label1 ;
t = v_16;
t = explode_string_0_0(sl, t);
if((t == NULL))
goto label1 ;
t = init_0_0(sl, t);
if((t == NULL))
goto label1 ;
{
struct str_closure n_165 = { &(lifted1) , &(frame) };
StrCL lifted1_cl = &(n_165);
t = drop_1_0(sl, lifted1_cl, t);
if((t == NULL))
goto label1 ;
t = implode_string_0_0(sl, t);
if((t == NULL))
goto label1 ;
t_16 = t;
}
goto label0 ;
label1 :
t = trm0;
{
ATerm trm3,trm4;
trm3 = SSL_get_constructor(t);
trm4 = SSL_get_arguments(t);
if(((ATgetType(trm4) == AT_LIST) && !(ATisEmpty(trm4))))
{
s_16 = ATgetFirst((ATermList) trm4);
r_16 = (ATerm) ATgetNext((ATermList) trm4);
}
else
goto fail1 ;
t = s_16;
t_16 = t;
goto label0 ;
}
label0 :
;
t = term3;
t = table_create_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = term7;
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = term11;
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = (ATerm) ATmakeAppl(sym__3, term3, term13, t_16);
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = u_16;
t = alltd_1_0(sl, lifted2_cl, t);
if((t == NULL))
goto fail1 ;
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail1 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted1 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted1";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term1;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail2 :
--__tracing_table_counter;
return(NULL);
}
ATerm main_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "main_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure f_165 = { &(scramblevariables_0_0) , sl };
StrCL lifted0_cl = &(f_165);
t = io_wrap_1_0(sl, lifted0_cl, t);
if((t == NULL))
goto fail0 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail0 :
--__tracing_table_counter;
return(NULL);
}
static void register_strategies (void)
{
int initial_size = 117;
int max_load = 75;
struct str_closure * closures;
int closures_index = 0;
if((strategy_table == NULL))
strategy_table = ATtableCreate(initial_size, max_load);
closures = (struct str_closure*) malloc((sizeof(struct str_closure) * 41));
if((closures == NULL))
{
perror("malloc error for registration of dynamic strategies");
exit(1);
}
closures[closures_index].fun = &(table_get_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_get_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(table_put_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_put_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(table_create_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_create_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(drop_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("drop_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(init_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("init_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(split_fetch_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("split_fetch_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(fetch_elem_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("fetch_elem_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(elem_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("elem_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(length_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("length_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(map_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("map_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(Snd_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("Snd_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(try_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("try_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(alltd_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("alltd_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(strcat_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("strcat_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(explode_string_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("explode_string_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(implode_string_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("implode_string_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(newname_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("newname_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(io_wrap_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("io_wrap_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted17);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted17", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted15);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted15", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted13);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted13", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted12);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted12", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted11);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted11", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted10);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted10", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted9);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted9", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(ScrambleVariables_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("ScrambleVariables_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted8);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted8", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted7);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted7", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(replace_2_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("replace_2_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted6);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted6", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted5);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted5", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(pop_frame_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("pop_frame_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(push_frame_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("push_frame_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(put_promoted_symbol_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("put_promoted_symbol_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(put_symbol_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("put_symbol_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted4);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted4", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted3);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted3", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(get_symbol_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("get_symbol_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted1);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted1", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(scramblevariables_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("scramblevariables_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(main_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("main_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
}
int main (int argc, char * argv [])
{
ATerm out_term;
ATermList in_term;
int i;
ATinit(argc, argv, &(out_term));
init_constructors();
in_term = ATempty;
for ( i = (argc - 1) ; (i >= 0) ; i-- )
{
in_term = ATinsert(in_term, (ATerm) ATmakeAppl0(ATmakeSymbol(argv[i], 0, ATtrue)));
}
SRTS_stratego_initialize();
memset(__tracing_table, 0, (sizeof(unsigned short) * TRACING_TABLE_SIZE));
__tracing_table_counter = 0;
register_strategies();
out_term = main_0_0(NULL, (ATerm) in_term);
if((out_term != NULL))
{
ATfprintf(stdout, "%t\n", out_term);
exit(0);
}
else
{
ATfprintf(stderr, "%s: rewriting failed, trace:\n", argv[0]);
for ( i = 0 ; (__tracing_table[i] && (i < TRACING_TABLE_SIZE)) ; i++ )
ATfprintf(stderr, "\t%s\n", __tracing_table[i]);
exit(1);
}
}
